
export default {
  namespaced: true,
  state: {
    num: 10
  },
  actions: {
    add_num_async ({ context }, n) {
      setTimeout(() => {
        context.commit('add_num', n)
      }, 2000)
    }
  },
  mutations: {
    add_num (state, n) {
      state.num += n
    },
    reduce_num (state, n) {
      state.num -= n
    }
  }
}
